
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>
#include <string.h>
#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>

int main ()
{
    int f = open ("/tmp/simplefs/a.file", O_RDWR);
    assert (f!=-1);
    lseek (f, 10, SEEK_SET);
    perror ("lseek");
    char temp[30];
    int l = read (f, temp, 6);
    printf ("%d\n", l);
    temp[l]='\0';
    write (f, "text", 4);
    close (f);
    printf ("%s\n", temp);
    return 0;
}

